package com.huaxin.hxcloud.Adapter;

import android.support.annotation.Nullable;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.huaxin.common.Entity.StationTaskDetail;
import com.huaxin.common.utils.Util;
import com.huaxin.hxcloud.R;

import java.util.List;

/**
 * @author lwjing
 * @date 2018/3/21
 * @Desc $desc$
 * Copyright HUAXIN DATA. All rights reserved.
 */
public class TaskXunJianPlanAdapter extends BaseQuickAdapter<StationTaskDetail.TaskItem, BaseViewHolder> {
    public TaskXunJianPlanAdapter(int layoutResId, @Nullable List<StationTaskDetail.TaskItem> data) {
        super(R.layout.item_xunjian_plan, data);
    }

    @Override
    protected void convert(BaseViewHolder viewHolder, StationTaskDetail.TaskItem workTask) {
        TextView tv_task_name = viewHolder.getView(R.id.tv_task_name);
        TextView tv_task_descirble = viewHolder.getView(R.id.tv_task_descirble);
        tv_task_name.setText(workTask.getName());
        if (Util.checkNull(workTask.getDes())) {
            tv_task_descirble.setText("描述：");
        } else {
            tv_task_descirble.setText("描述：\n" + workTask.getDes());
        }
    }
}
